package com.guet.careapp.controller.spring;

import com.guet.careapp.service.IUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("user1")
public class UserController {

  @Autowired
  private IUserInfoService userInfoService;


  @RequestMapping("u")
  public String showUserInfo() {

    System.out.println(userInfoService.findAll().get(0).getImage());
    return "/user/showInfo";
  }

//    private static final Logger LOGGER = Logger.getLogger(UserController.class);
//
//    @Autowired
//    private IUserService userService;
//
//    @RequestMapping("/showInfo/{userId}")
//    public String showUserInfo(ModelMap modelMap, @PathVariable String userId) {
//        LOGGER.info("查询用户：" + userId);
//        AcctUser userInfo = userService.load(userId);
//        modelMap.addAttribute("userInfo", userInfo);
//        return "/user/showInfo";
//    }
//
//    @RequestMapping("/showInfos")
//    public @ResponseBody
//    List<AcctUser> showUserInfos() {
//        LOGGER.info("查询用户全部用户");
//        List<AcctUser> userInfos = userService.findAll();
//        return userInfos;
//    }
}
